from flask import Flask
from middleware.middleware import log_middleware, auth_middleware

app = Flask(__name__)

# 注册日志中间件
log_middleware(app)

# 注册权限检查中间件
auth_middleware(app)

@app.route('/')
def home():
    return 'Hello, Flask Middleware!'

@app.route('/admin')
def admin():
    return 'Welcome to the Admin Page!'

if __name__ == '__main__':
    app.run(debug=True)